package com.haiyou.common.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;


/**
 * 登录表单
 */
@Data
@ApiModel(value = "登录表单")
public class LoginForm {

    @ApiModelProperty(value = "账号")
    @NotBlank(message = "账号不能为空")
    private String username;

    @ApiModelProperty(value = "密码/验证码")
    @NotBlank(message = "凭证不能为空")
    private String authCode;

    @ApiModelProperty(value = "登录类型：1 账号，2 手机号，默认1帐号登录", name = "type")
    @NotNull(message = "登录类型不能为空")
    @Range(min = 1, max = 2, message = "登录类型错误")
    private String type = "1";

}
